package cn.felord.security.autoconfigure.context;

/**
 * @author felord.cn
 * @since 2021/8/6 17:27
 */
public class ClientContextHolder {
    private static final ThreadLocal<ClientContext> CONTEXT_HOLDER = new ThreadLocal<>();

    public ClientContextHolder() {
    }

    public static void setContext(ClientContext client) {
        CONTEXT_HOLDER.set(client);
    }

    public static ClientContext getContext() {
        return CONTEXT_HOLDER.get();
    }

    public static void clearContext() {
        CONTEXT_HOLDER.remove();
    }
}
